import api from "../../api"

const getCurrentUserAppAjax = function (params) {
  return api.getRequest(api.requestURL + 'web' + api.apiVer + 'clients/current/client', params)
}

const resetAppSecretAjax = function (params) {
  return api.postRequest(api.requestURL + 'web' + api.apiVer + 'clients/reset/secret', params)
}

const deleteAppAjax = function (params) {
  return api.deleteRequest(api.requestURL + 'web' + api.apiVer + 'clients/' + params.id)
}

// 更新应用管理员
const saveOrUpdateClientAdmin = function (params, clientDetailId) {
  return api.postRequest(api.requestURL + 'web' + api.apiVer + 'users/saveOrUpdateClientAdmin', params)
}

export default {
  getCurrentUserAppAjax,
  resetAppSecretAjax,
  deleteAppAjax,
  saveOrUpdateClientAdmin
}
